<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;
use OT\DataDictionary;

/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class ProductmanagementController extends HomeController {
    
	//展位管理
	public function product_management(){
        $map = array();
        $map  = array('status' => 1);
        if(isset($_GET['name'])){
            $map['name']    =   array('like', '%'.(string)I('name').'%');
        }
		
		$lists = $this->lists('Customer_info',$map,'uid asc');
		//$lists  = D('Customer_info')->where($map)->order('uid asc')->select();//查询语句
    	$this->assign('productmanagement',$lists);
	 
	    $this->display();
	}

	//产品审核
	public function product_review(){
		
	    $this->display();
	}

	//删除操作
	public function del(){
		$id=array_unique((array)I('uid',0));
		if(empty($id)){
			$this->error('请输入数据!');

		}
		$where=array('uid'=>array('in',$id));
		if(M('Customer_info')->where($where)->delete()){
			S('DB_CONFIG_DATA',null);
			//记录行为
			action_log('update_config','Customer_info',$id,UID);
			$this->success('删除成功');
		}else{
			$this->error('删除失败');
		}
	}

}




?>